package org.someone.common;

import java.util.Comparator;
import java.util.Map;

public class ComparatorForMapSort implements Comparator<Object> {
	private String strSortField;
	
	public ComparatorForMapSort(String strSortField){
		this.strSortField = strSortField;
	}
	
	@SuppressWarnings("unchecked")
	@Override
	public int compare(Object o1, Object o2) {
		Map<String,String> m1=(Map<String,String>)o1; 
		Map<String,String> m2=(Map<String,String>)o2;
		return DateUtil.getDateTime(m1.get(strSortField)).compareTo(DateUtil.getDateTime(m2.get(strSortField)));
	}
	
}
